package nc.bs.sj.dataservlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import nc.bs.dao.BaseDAO;
import nc.bs.framework.adaptor.IHttpServletAdaptor;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.bs.uap.lock.PKLock;
import nc.itf.bd.bankacc.cust.ICustBankaccService;
import nc.itf.bd.supplier.baseinfo.ISupplierBaseInfoService;
import nc.itf.uap.IUAPQueryBS;
import nc.itf.uif.pub.IUifService;
import nc.jdbc.framework.processor.BeanProcessor;
import nc.jdbc.framework.processor.MapListProcessor;
import nc.md.persist.framework.IMDPersistenceQueryService;
import nc.pub.uapbd.util.FileKit;
import nc.pub.uapbd.util.HttpUtil;
import nc.pub.uapbd.util.ToolHelper;
import nc.vo.bd.address.AddressVO;
import nc.vo.bd.bankaccount.BankAccSubVO;
import nc.vo.bd.bankaccount.BankAccbasVO;
import nc.vo.bd.bankaccount.cust.CustBankaccUnionVO;
import nc.vo.bd.cust.CustbankVO;
import nc.vo.bd.supplier.SupplierVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.VOStatus;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDate;
import nc.vo.pub.lang.UFDateTime;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class ToSuplierDataServlet extends CheckDataRule implements IHttpServletAdaptor  {
	public List<String> log_list = new ArrayList<String>();
	IUifService iUifService = NCLocator.getInstance().lookup(IUifService.class);
	
	ToolHelper helper = new ToolHelper();
	ICustBankaccService custBankaccinfoService = NCLocator.getInstance().lookup(ICustBankaccService.class);
	IUAPQueryBS iuap = (IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
	IMDPersistenceQueryService iMDPersistenceQueryService = NCLocator.getInstance().lookup(IMDPersistenceQueryService.class);

	@Override
	public void doAction(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		ISupplierBaseInfoService it =  NCLocator.getInstance().lookup(ISupplierBaseInfoService.class);
		JSONObject resultMap= new JSONObject();
		resultMap.put("STATUS", "200");
		try{
			//  ?    
			String reqParas = HttpUtil.getRequestParams(request);
			//      ?
			String data=super.checkReqParams(request.getRemoteAddr(),reqParas);
			//    ��?    ?   ? 
		    JSONArray arr=  JSONArray.parseArray(data);
		    BaseDAO dao = new BaseDAO();
		    if(arr!=null && !arr.isEmpty()){
		    	
		    	for (int i = 0; i < arr.size(); i++) {
		    		JSONObject jsonObject = arr.getJSONObject(i);
		
					String type = jsonObject.getString("type");
					if("enable".equals(type)){
						
							 String taxpayerid = jsonObject.getString("taxpayerid");
							 SupplierVO vo = getSupplierVOByTaxpayerid(taxpayerid);
							 if(vo!=null){
								 it.enableSupBaseInfo(new SupplierVO[]{vo});
							 }
							
					}else if("disable".equals(type)){
				
							
							 String taxpayerid = jsonObject.getString("taxpayerid");
							 SupplierVO vo = getSupplierVOByTaxpayerid(taxpayerid);
							 if(vo!=null){
								 it.disableSupBaseInfo(new SupplierVO[]{vo});
							 }
							
					}else{
					
							
							 SupplierVO vo = json2SupplierVO(jsonObject, VOStatus.UPDATED);
							 String primaryKey = null;
							 JSONArray cusbank = jsonObject.getJSONArray("supbank");
								if(vo.getPrimaryKey()!=null){
									it.updateSupplierVO(vo, false);
									primaryKey = vo.getPrimaryKey();
								}else{
									it.insertSupplierVO(vo, false);
									primaryKey = vo.getPrimaryKey();
	
								}
								if(cusbank!=null && !cusbank.isEmpty()){
									dealcusBankinfo(cusbank,primaryKey);	
								}	
					}	
				}	
		    }
			resultMap.put("STATUS", "200");
			resultMap.put("MESSAGE", "成功");
			resultMap.put("DATA", null);
			this.messageSend(resultMap.toJSONString(), response);
			
			//
			//end	
		}catch(Exception e){
			resultMap.put("STATUS", "400");
			resultMap.put("MESSAGE", e.getMessage());
			resultMap.put("DATA", null);
			this.messageSend(resultMap.toJSONString(), response);
			StackTraceElement[] stack=	e.getStackTrace();
			for (int j = 0; j < e.getStackTrace().length; j++) {
				log_list.add(e.getStackTrace()[j].getClassName()+"("+e.getStackTrace()[j].getMethodName()+e.getStackTrace()[j].getLineNumber()+")\\n");
			}	
		}finally{
			FileKit.addTask(log_list, "ToCustDataServlet");
		}
		
	}
	
	public SupplierVO getSupplierVOByTaxpayerid(String taxpayerid) throws Exception{
		
		SupplierVO[] oldVOs = (SupplierVO[])this.iUifService.queryByCondition(SupplierVO.class, " taxpayerid = '"+taxpayerid+"' and nvl(dr,0)=0");
		if(oldVOs != null && oldVOs.length>0){
			return oldVOs[0];
		}
		return null;

		
	}
	
	private SupplierVO json2SupplierVO(JSONObject tmpJson,int status) throws Exception {
		SupplierVO vo  = null;
		UFBoolean f = new UFBoolean(false);

		String pk_group = InvocationInfoProxy.getInstance().getGroupId();
		String userId = InvocationInfoProxy.getInstance().getUserId();
		if(tmpJson != null){
			HashMap<String, Object> tempMap = new HashMap();
			String pk_supplierclass = tmpJson.getString("pk_supplierclass");
			String pk_org = tmpJson.getString("pk_org");
			String name = tmpJson.getString("name");
			String def2 = tmpJson.getString("def2");
			String supstate = tmpJson.getString("supstate");
			String supprop = tmpJson.getString("supprop");
			String def1 = tmpJson.getString("def1");
			String taxpayerid = tmpJson.getString("taxpayerid");
			String pk_country = tmpJson.getString("pk_country");
			String pk_timezone = tmpJson.getString("pk_timezone");
			String pk_format = tmpJson.getString("pk_format");
			String pk_currtype = tmpJson.getString("pk_currtype");
			String corpaddress = tmpJson.getString("corpaddress");
			String tel1 = tmpJson.getString("tel1");
			SupplierVO[] oldVOs = (SupplierVO[])this.iUifService.queryByCondition(SupplierVO.class, " taxpayerid = '"+taxpayerid+"' and nvl(dr,0)=0");
			if(oldVOs != null && oldVOs.length>0){
				vo = oldVOs[0];	
				vo.setStatus(VOStatus.UPDATED);
			}else{
				vo = new SupplierVO();
				vo.setTs(new UFDateTime());
				vo.setPk_group(pk_group);
				vo.setStatus(VOStatus.NEW);
				vo.setIsvat(f);
				vo.setIsfreecust(f);
				vo.setEnablestate(2);
				vo.setDataoriginflag(0);
				vo.setSupstate(1);
				vo.setIsoutcheck(f);
				vo.setStatus(VOStatus.NEW);
				vo.setPk_org("0001A11000000000037Y");
				vo.setPk_supplierclass("1001A11000000000212Z");
				vo.setSupprop(0);
				vo.setDef1("1001A110000000008CK2");
				vo.setTaxpayerid(taxpayerid);

				vo.setPk_currtype("1002Z0100000000001K1");//?        
				vo.setPk_format("FMT0Z000000000000000");//?  
				vo.setPk_timezone("0001Z010000000079U2P");//?  
				vo.setPk_country("0001Z010000000079UJJ");//?  
				
				vo.setCreator(userId);

				vo.setPk_group(pk_group);	
			} 
			String addressPK = getAddressPK(corpaddress);
			if(addressPK!=null){
				vo.setCorpaddress(addressPK);
			}
			vo.setName(name);
			vo.setDef2(def2);
			vo.setTel1(tel1);
	
		}
	
		
		return vo;

	}
	
	
	public String getAddressPK(String address) throws BusinessException{
		if(isNull(address)){
			return null;
		}
		String pk = "";
		String sql =  " select pk_address from bd_address where detailinfo = '"+address+"' and city is null and  country is null and province is null ";
		
		ArrayList<HashMap<String, Object>> arrlist = (ArrayList<HashMap<String, Object>>) iuap.executeQuery(sql, new MapListProcessor());
		if(arrlist!=null && !arrlist.isEmpty()){
			return  arrlist.get(0).get("pk_address").toString();
		}
		AddressVO vo = new AddressVO();
		vo.setDetailinfo(address);
		BaseDAO b = new BaseDAO();
		b.insertVO(vo);
		return vo.getPk_address();
		
	}
	
	/**
	 * 
	 * @param cusbank
	 * @param pk_customer
	 * @throws Exception
	 */
	private void dealcusBankinfo(JSONArray cusbank,String pk_customer) throws Exception {
		IUAPQueryBS iuap = (IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
		IMDPersistenceQueryService iMDPersistenceQueryService = NCLocator.getInstance().lookup(IMDPersistenceQueryService.class);
		for (int i = 0; i < cusbank.size(); i++) {
			JSONObject jsonCusbank = cusbank.getJSONObject(i);
			String btype = jsonCusbank.getString("type");
			String accnum = jsonCusbank.getString("accnum");
			String accname = jsonCusbank.getString("accname");
			String pk_banktype = jsonCusbank.getString("pk_banktype");
			String pk_bankdoc = jsonCusbank.getString("pk_bankdoc");
			String accountproperty = jsonCusbank.getString("accountproperty");//0=  ?  1=   ?  
			String enablestate = jsonCusbank.getString("enablestate");
			String pk_currtype = jsonCusbank.getString("bpk_currtype");
			String enableuser = jsonCusbank.getString("enableuser");
			if(isNull(accnum)){
				throw new Exception("accnum不能为空 ");
			}
			if(isNull(accname)){
				throw new Exception("accnum不能为空");
			}
			if(isNull(pk_banktype)){
				throw new Exception("pk_banktype不能为");
			}
			if(isNull(accountproperty)){
				throw new Exception("accountproperty不能为空");
			}
			if(isNull(pk_bankdoc)){
				throw new Exception("pk_bankdoc不能为空");
			}
			if(isNull(pk_currtype)){
				throw new Exception("pk_currtype不能为空");
			}
			if(isNull(enablestate)){
				throw new Exception("enablestate不能为空 ");
			}
			
			CustBankaccUnionVO unionvo = new CustBankaccUnionVO();
			
			if(!"enable".equals(btype)&&!"disable".equals(btype)){
				String sql_base="select * from bd_bankaccbas where accnum='"+accnum+"' and nvl(dr,0) = 0  ";
//				List<Map<String, Object>> list=(List<Map<String, Object>>) iuap.executeQuery(sql_base,new MapListProcessor());
				
//				String sql = " select * from bd_bankaccbas where pk_bankaccbas in ( select pk_bankaccbas from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				BankAccbasVO bankaccbasvo = (BankAccbasVO) iuap.executeQuery(sql_base,new  BeanProcessor(BankAccbasVO.class));
				
				if(bankaccbasvo!=null){
					btype="update";
				}else{
					btype="insert";
				}
			}
			
			if("insert".equals(btype)){
			
				BankAccbasVO bankaccbasvo  = new BankAccbasVO();
				
				bankaccbasvo.setAccname(accname);
				bankaccbasvo.setAccclass(3);
				bankaccbasvo.setAccnum(accnum);
				bankaccbasvo.setAccopendate(new UFDate());
				bankaccbasvo.setAccountproperty(new Integer(accountproperty));
				bankaccbasvo.setAccstate(0);
				
				bankaccbasvo.setStatus(VOStatus.NEW);
				bankaccbasvo.setDataoriginflag(0);
				bankaccbasvo.setEnablestate(2);

				
				HashMap<String, Object> infoByFieldView = helper.getInfoByFieldView("bd_bankdoc", "name", pk_bankdoc);
				if(infoByFieldView!=null && !infoByFieldView.isEmpty()){	
					 bankaccbasvo.setPk_bankdoc(infoByFieldView.get("pk_bankdoc").toString());
				}else{
					throw new BusinessException("NC65中没有找到【" + pk_bankdoc + "】的银行档案！");
				}
				
				infoByFieldView = helper.getInfoByFieldView("bd_banktype", "name", pk_banktype);
				if(infoByFieldView!=null && !infoByFieldView.isEmpty()){	
					 bankaccbasvo.setPk_banktype(infoByFieldView.get("pk_banktype").toString());
				}else{
					throw new BusinessException("NC65中没有找到【" + pk_banktype + "】的银行类别！");
				}
				

				bankaccbasvo.setPk_group(InvocationInfoProxy.getInstance().getGroupId());
				bankaccbasvo.setQrybalanceitf(0);
				bankaccbasvo.setSharetag(new UFBoolean(false));
				bankaccbasvo.setPk_group("0001A11000000000037Y");
				
				BankAccSubVO[] bankaccsubvos = new BankAccSubVO[1];
				BankAccSubVO bankaccsubvo = new BankAccSubVO();
				bankaccsubvo.setDataoriginflag(0);
				bankaccsubvo.setFronzenstate(0);
				bankaccsubvo.setStatus(VOStatus.NEW);
				
				infoByFieldView = helper.getInfoByFieldView("bd_currtype", "code", pk_currtype);
				if(infoByFieldView!=null && !infoByFieldView.isEmpty()){	
					bankaccsubvo.setPk_currtype(infoByFieldView.get("pk_currtype").toString());
				}else{
					throw new BusinessException("NC65中没有通过编码 找为【" + pk_banktype + "】的币种！");
				}

				bankaccsubvos[0] = bankaccsubvo;
				bankaccbasvo.setBankaccsub(bankaccsubvos);
				CustbankVO custbankVO = new CustbankVO();
				custbankVO.setPk_cust(pk_customer);
				custbankVO.setDataoriginflag(0);
				custbankVO.setAccclass(3);
				unionvo.setBankaccbasVO(bankaccbasvo);
				unionvo.setCustbankVO(custbankVO);
				custbankVO.setPk_cust(pk_customer);
				
				custBankaccinfoService.insertCustBankacc(unionvo);
				
				//------------------ 设置当前启动人
				InvocationInfoProxy.getInstance().setUserId("1001G9100000009WUK3G");
				
				//----------start--------启动当前银行信息
				String sql = " select * from bd_bankaccbas where pk_bankaccbas in ( select pk_bankaccbas from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";

				 bankaccbasvo = (BankAccbasVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccbasVO.class));
				
				sql = "  select * from bd_bankaccsub where pk_bankaccsub in ( select pk_bankaccsub from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				BankAccSubVO subvo = (BankAccSubVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccSubVO.class));
				bankaccbasvo.setBankaccsub(new BankAccSubVO[]{subvo});
				bankaccbasvo.setStatus(VOStatus.UPDATED);
				
				
				String pk_bankaccbas = bankaccbasvo.getPk_bankaccbas();
				String pk_bankaccsub = subvo.getPk_bankaccsub();
				
				sql =  " select * from bd_custbank where pk_cust = '"+pk_customer+"' and pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
//				sql =  " select * from bd_custbank where pk_cust = '"+pk_customer+"' and pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
				
				 custbankVO = (CustbankVO) iuap.executeQuery(sql,new  BeanProcessor(CustbankVO.class));
				 CustBankaccUnionVO unionvo2 = new CustBankaccUnionVO();		
				 unionvo2.setBankaccbasVO(bankaccbasvo);
				 unionvo2.setCustbankVO(custbankVO);
				 unionvo2.setStatus(VOStatus.UPDATED);
				
				PKLock.getInstance().releaseDynamicLocks();
				
				custBankaccinfoService.enableCustBankacc(unionvo2);
				//------------------启动当前银行信息
				
			}else if("update".equals(btype)){
				
//				String sql = " select * from bd_bankaccbas where pk_bankaccbas in ( select pk_bankaccbas from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				String sql = " select * from bd_bankaccbas where  accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				BankAccbasVO bankaccbasvo = (BankAccbasVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccbasVO.class));
				
//				sql = "  select * from bd_bankaccsub where pk_bankaccsub in ( select pk_bankaccsub from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				sql = "  select * from bd_bankaccsub where  accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				BankAccSubVO subvo = (BankAccSubVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccSubVO.class));
				HashMap<String, Object> infoByFieldView = helper.getInfoByFieldView("bd_bankdoc", "name", pk_bankdoc);
				if(infoByFieldView!=null && !infoByFieldView.isEmpty()){	
					 bankaccbasvo.setPk_bankdoc(infoByFieldView.get("pk_bankdoc").toString());
				}else{
					throw new BusinessException("NC65中没有找到【" + pk_bankdoc + "】的银行档案！");
				}
				bankaccbasvo.setAccname(accname);
				bankaccbasvo.setBankaccsub(new BankAccSubVO[]{subvo});
				bankaccbasvo.setStatus(VOStatus.UPDATED);
			
				
				String pk_bankaccbas = bankaccbasvo.getPk_bankaccbas();
				String pk_bankaccsub = subvo.getPk_bankaccsub();
				
//				sql =  " select * from bd_custbank where pk_cust = '"+pk_customer+"' and pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
				sql =  " select * from bd_custbank where  pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
				
				CustbankVO custbankVO = (CustbankVO) iuap.executeQuery(sql,new  BeanProcessor(CustbankVO.class));
						
				unionvo.setBankaccbasVO(bankaccbasvo);
				unionvo.setCustbankVO(custbankVO);
				unionvo.setStatus(VOStatus.UPDATED);
				
				
				custBankaccinfoService.updateCustBankacc(unionvo);

				
				
//				custBankaccinfoService.updateCustBankacc(unionvo);
			}else if("enable".equals(btype)){
				
				if(isNull(enableuser)){
					throw new Exception("启用人enableuser为空");
				}
				
			
				
				HashMap<String, Object> infoByFieldView = helper.getInfoByFieldView("sm_user", "user_code", enableuser);
				if(infoByFieldView!=null && !infoByFieldView.isEmpty()){
					String cuserid = (String) infoByFieldView.get("cuserid");
				}else{
					throw new BusinessException("通过user_code没有找到操作人");
				}
				InvocationInfoProxy.getInstance().setUserId(enableuser);
	
//				String sql = " select * from bd_bankaccbas where pk_bankaccbas in ( select pk_bankaccbas from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				String sql = " select * from bd_bankaccbas where  accnum = '"+accnum+"' and nvl(dr,0) = 0 ";

				BankAccbasVO bankaccbasvo = (BankAccbasVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccbasVO.class));
				
//				sql = "  select * from bd_bankaccsub where pk_bankaccsub in ( select pk_bankaccsub from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				sql = "  select * from bd_bankaccsub where  accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				BankAccSubVO subvo = (BankAccSubVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccSubVO.class));
				bankaccbasvo.setBankaccsub(new BankAccSubVO[]{subvo});
				bankaccbasvo.setStatus(VOStatus.UPDATED);
				
				
				String pk_bankaccbas = bankaccbasvo.getPk_bankaccbas();
				String pk_bankaccsub = subvo.getPk_bankaccsub();
				
				sql =  " select * from bd_custbank where  pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
//				sql =  " select * from bd_custbank where pk_cust = '"+pk_customer+"' and pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
				
				CustbankVO custbankVO = (CustbankVO) iuap.executeQuery(sql,new  BeanProcessor(CustbankVO.class));
						
				unionvo.setBankaccbasVO(bankaccbasvo);
				unionvo.setCustbankVO(custbankVO);
				unionvo.setStatus(VOStatus.UPDATED);
				
				PKLock.getInstance().releaseDynamicLocks();
				
				custBankaccinfoService.enableCustBankacc(unionvo);
				
				
			}else if("disable".equals(btype)){

			
//				String sql = " select * from bd_bankaccbas where pk_bankaccbas in ( select pk_bankaccbas from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				String sql = " select * from bd_bankaccbas where  accnum = '"+accnum+"' and nvl(dr,0) = 0 ";

				BankAccbasVO bankaccbasvo = (BankAccbasVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccbasVO.class));
				
//				sql = "  select * from bd_bankaccsub where pk_bankaccsub in ( select pk_bankaccsub from bd_custbank where pk_cust = '"+pk_customer+"' ) and accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				sql = "  select * from bd_bankaccsub where  accnum = '"+accnum+"' and nvl(dr,0) = 0 ";
				BankAccSubVO subvo = (BankAccSubVO) iuap.executeQuery(sql,new  BeanProcessor(BankAccSubVO.class));
				bankaccbasvo.setBankaccsub(new BankAccSubVO[]{subvo});
				bankaccbasvo.setStatus(VOStatus.UPDATED);
				
				
				String pk_bankaccbas = bankaccbasvo.getPk_bankaccbas();
				String pk_bankaccsub = subvo.getPk_bankaccsub();
				
//				sql =  " select * from bd_custbank where pk_cust = '"+pk_customer+"' and pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
				sql =  " select * from bd_custbank where  pk_bankaccbas = '"+pk_bankaccbas+"'   and pk_bankaccsub = '"+pk_bankaccsub+"' ";
				
				CustbankVO custbankVO = (CustbankVO) iuap.executeQuery(sql,new  BeanProcessor(CustbankVO.class));
						
				unionvo.setBankaccbasVO(bankaccbasvo);
				unionvo.setCustbankVO(custbankVO);
				unionvo.setStatus(VOStatus.UPDATED);
				custBankaccinfoService.disableCustBankacc(unionvo);
				
			}

			
		}
	
	}
	

	
	private boolean isNull(Object obj) {
		if (obj == null || "".equals(obj.toString().trim())|| "null".equals(obj.toString().trim())) {
			return true;
		}
		return false;
	}


	/**
	 *       ?
	 *
	 * @param msgs
	 * @param response
	 * @return
	 * @throws IOException
	 */
	private Object messageSend(String msgs, HttpServletResponse response) throws IOException {
		response.setCharacterEncoding("UTF-8");
		response.setHeader("contentType", "application/json; charset=utf-8");
		response.setContentType("application/json; charset=utf-8");
		response.getWriter().println(msgs);
		return null;
	}
}
